package com.glsc.ngateway.common.base.domain.mysql.flowable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 流程业务需求表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "t_flowable_demand")
@Inheritance(strategy = InheritanceType.JOINED)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class FlowableDemand implements Serializable {

    @ApiModelProperty(value = "流程实例id")
    @Id
    @Column(name = "vc_process_instance_id", columnDefinition = "varchar(64) '")
    private String processInstanceId;

    @ApiModelProperty(value = "需求提出部门")
    @Column(name = "vc_department", columnDefinition = "varchar(50) '")
    private String department;

    @ApiModelProperty(value = "需求系统名称")
    @Column(name = "vc_system_id", columnDefinition = "varchar(50) '")
    private String systemId;

    @ApiModelProperty(value = "需求提出人")
    @Column(name = "vc_staff", columnDefinition = "varchar(10) '")
    private String staff;

    @ApiModelProperty(value = "原始需求人")
    @Column(name = "vc_original_staff", columnDefinition = "varchar(10) '")
    private String originalStaff;

    @ApiModelProperty(value = "原始需求人中文")
    @Column(name = "vc_original_staff_name", columnDefinition = "varchar(10) '")
    private String originalStaffName;

    @ApiModelProperty(value = "需求类型 需求类别0业务系统功能1业务报表2业务数据处理3内部系统功能4内部报表")
    @Column(name = "c_demand_type", columnDefinition = "varchar(5) '")
    private String demandType;

    @ApiModelProperty(value = "需求紧急级别 0一般1紧急2top")
    @Column(name = "c_demand_emerge_level", columnDefinition = "varchar(5) '")
    private String demandEmergeLevel;

    @ApiModelProperty(value = "需求详述")
    @Column(name = "vc_demand_detail", columnDefinition = "varchar(2048) '")
    private String demandDetail;

    @ApiModelProperty(value = "需求文档")
    @Column(name = "vc_demand_document", columnDefinition = "varchar(2048) '")
    private String demandDocument;

    @ApiModelProperty(value = "需求关联页面")
    @Column(name = "vc_demand_url", columnDefinition = "varchar(2048) '")
    private String demandUrl;

    @ApiModelProperty(value = "方案简述")
    @Column(name = "vc_solution_general", columnDefinition = "varchar(1024) '")
    private String solutionGeneral;

    @ApiModelProperty(value = "技术文档")
    @Column(name = "vc_solution_document", columnDefinition = "varchar(2048) '")
    private String solutionDocument;

    @ApiModelProperty(value = "排期信息")
    @Column(name = "vc_arrangeinfo", columnDefinition = "varchar(2048) '")
    private String arrangeinfo;

    @ApiModelProperty(value = "上线信息")
    @Column(name = "vc_onlineinfo", columnDefinition = "varchar(2048) '")
    private String onlineinfo;

    @ApiModelProperty(value = "需求创建时间")
    @Column(name = "dt_create_time", columnDefinition = "datetime'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "操作时间")
    @Column(name = "dt_op_time", columnDefinition = "datetime comment '操作时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime opTime;

    @ApiModelProperty(value = "oa流程")
    @Column(name = "vc_request_id", columnDefinition = "varchar(20) '")
    private String requestId;

    @ApiModelProperty(value = "oapdf")
    @Column(name = "vc_oa_pdf_file", columnDefinition = "varchar(100) '")
    private String oaPdfFile;

    @ApiModelProperty(value = "需求级别123 一级二级三级")
    @Column(name = "c_demand_level", columnDefinition = "varchar(5) '")
    private String demandLevel;

}
